package com.study.controller;

import com.study.common.ResultJson;
import com.study.pojo.Comments;
import com.study.service.CommentsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 社交模块控制器，包括点赞评论+电影评分
 */

@Controller
@RequestMapping("/social")
public class SocialController {

    @Resource
    private CommentsService commentsService;


    /**
     * 添加一条评论
     * @param comments
     * @return
     */
    @RequestMapping("/addComment")
    @ResponseBody
    public ResultJson addComment(Comments comments){
        int commentId = commentsService.insert(comments);
        return ResultJson.ok(commentId);
    }

}
